﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Sys_Config
/// </summary>
/// 
namespace Pan
{
    public class Sys_Config
    {
        public Sys_Config()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public static string OrderPayWay(string flag)
        {
            switch (flag)
            {
                case "0":
                    return "M币支付[团购价格]";
                case "1":
                    return "支付宝[团购价格]";
                    break;
                case "2":
                    return "财付通[团购价格]";
                    break;
                case "11":
                    return "支付宝[常规折扣价]";
                case "12":
                    return "财付通[常规折扣价]";
                default :
                    return "";
                    break;
            }
        }

        public static void InitCity(string code)
        {
            Tuan.Model.City cityobj = (new Tuan.BLL.City()).GetModel(code);

            if (string.IsNullOrEmpty(cityobj.Code))
            {
                //HttpContext.Current.Response.Redirect("http://www.5151feel.com/");
                //IntiCity(System.Configuration.ConfigurationManager.AppSettings["defaultCity"].ToString());
                return;
            }
            Cookie.WriteCookie("citycode", cityobj.Code);
            Cookie.WriteCookie("cityname", cityobj.CityName);
            Cookie.WriteCookie("cityid", cityobj.CityID.ToString());
        }
        public static string GetCurrentCityName()
        {
            //WebHelper.Pages.Log.WriteLog("读取AreaID");
            return Cookie.GetCookie("cityname");
            //  return areaObj.AreaID.ToString();
        }
        public static string GetCurrentCityID()
        {
            //WebHelper.Pages.Log.WriteLog("读取AreaID");
            return Cookie.GetCookie("cityid");
            //  return areaObj.AreaID.ToString();
        }
    }
}
